home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / bytesc88.arc / CC.DEF < prev    next >
Text File  |  1980-01-01  |  3KB  |  147 lines

  1. /*
  2. ** Small-C Compiler Symbol Definitions
  3. */
  4.  
  5. /*
  6. ** compile options
  7. */
  8.  
  9. /* #define NOCCARGC    
  10. */
  11.  
  12. #define SEPARATE    /* compile separately */
  13. #define OPTIMIZE    /* compile output optimizer */
  14. #define DYNAMIC     /* allocate memory dynamically */
  15. #define COL        /* terminate labels with a colon */
  16. /* #define UPPER    /* force symbols to upper case */
  17. #define LINK        /* will use with linking loader */
  18.  
  19. /*
  20. ** machine dependent parameters
  21. */
  22. #define BPW     2    /* bytes per word */
  23. #define LBPW    1    /* log2(BPW) */
  24. #define SBPC    1    /* stack bytes per character */
  25. #define ERRCODE 7    /* op sys return code */
  26.  
  27. /*
  28. ** symbol table format
  29. */
  30. #define IDENT    0
  31. #define TYPE     1
  32. #define CLASS    2
  33. #define OFFSET   3
  34. #define NAME     5
  35. #define OFFSIZE (NAME-OFFSET)
  36. #define SYMAVG  10
  37. #define SYMMAX  14
  38.  
  39. /*
  40. ** symbol table parameters
  41. */
  42. #define NUMLOCS   25
  43. #define STARTLOC  symtab
  44. #define ENDLOC   (symtab+(NUMLOCS*SYMAVG))
  45. #define NUMGLBS   200
  46. #define STARTGLB  ENDLOC
  47. #define ENDGLB   (ENDLOC+((NUMGLBS-1)*SYMMAX))
  48. #define SYMTBSZ   3050  /* NUMLOCS*SYMAVG + NUMGLBS*SYMMAX */
  49.  
  50. /*
  51. ** System wide name size (for symbols)
  52. */
  53. #define NAMESIZE 9
  54. #define NAMEMAX  8
  55.  
  56. /*
  57. ** possible entries for "IDENT"
  58. */
  59. #define LABEL    0
  60. #define VARIABLE 1
  61. #define ARRAY    2
  62. #define POINTER  3
  63. #define FUNCTION 4
  64.  
  65. /*
  66. ** possible entries for "TYPE"
  67. **    low order 2 bits make type unique within length
  68. **    high order bits give length of object
  69. */
  70. /*      LABEL   0 */
  71. #define CCHAR   (1<<2)
  72. #define CINT    (BPW<<2)
  73.  
  74. /*
  75. ** possible entries for "CLASS"
  76. */
  77. /*      LABEL     0 */
  78. #define STATIC    1
  79. #define AUTOMATIC 2
  80. #define EXTERNAL  3
  81. #define AUTOEXT   4
  82.  
  83. /*
  84. ** "switch" table
  85. */
  86. #define SWSIZ   (2*BPW)
  87. #define SWTABSZ (60*SWSIZ)
  88.  
  89. /*
  90. ** "while" statement queue
  91. */
  92. #define WQTABSZ  30
  93. #define WQSIZ     3
  94. #define WQMAX   (wq+WQTABSZ-WQSIZ)
  95.  
  96. /*
  97. ** entry offsets in while queue
  98. */
  99. #define WQSP    0
  100. #define WQLOOP  1
  101. #define WQEXIT  2
  102.  
  103. /*
  104. ** literal pool
  105. */
  106. #define LITABSZ 800
  107. #define LITMAX  (LITABSZ-1)
  108.  
  109. /*
  110. ** input line
  111. */
  112. #define LINEMAX  127
  113. #define LINESIZE 128
  114.  
  115. /*
  116. ** output staging buffer size
  117. */
  118. #define STAGESIZE   1200
  119. #define STAGELIMIT  (STAGESIZE-1)
  120.  
  121. /*
  122. ** macro (define) pool
  123. */
  124. #define MACNBR   130
  125. #define MACNSIZE (MACNBR*(NAMESIZE+2))
  126. #define MACNEND  (macn+MACNSIZE)
  127. #define MACQSIZE (MACNBR*7)
  128. #define MACMAX   (MACQSIZE-1)
  129.  
  130. /*
  131. ** statement types
  132. */
  133. #define STIF      1
  134. #define STWHILE   2
  135. #define STRETURN  3
  136. #define STBREAK   4
  137. #define STCONT    5
  138. #define STASM     6
  139. #define STEXPR    7
  140. #define STDO      8    /* compile "do" logic */
  141. #define STFOR     9    /* compile "for" logic */
  142. #define STSWITCH 10    /* compile "switch/case/default" logic */
  143. #define STCASE   11
  144. #define STDEF    12
  145. #define STGOTO   13    /* compile "goto" logic */
  146. #define STLABEL  14
  147.